package com.itheima.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.mapper.MenuMapper;
import com.itheima.pojo.Menu;
import com.itheima.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service(interfaceClass = MenuService.class)
public class MenuServiceImpl implements MenuService {

    @Autowired
    private MenuMapper menuMapper;

    /**
     * 获取所有菜单
     *
     * @return
     */
    @Override
    public List<Menu> findAll() {
        return menuMapper.findAll();
    }

    /**
     * 根据角色id获取菜单的id
     *
     * @param id
     * @return
     */
    @Override
    public List<Integer> findMenuIdsByRoleId(Integer id) {
        return menuMapper.findMenuIdsByRoleId(id);
    }
}
